package top.mcwebsite.playandroid.home.ui

import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.material3.Divider
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.text.style.LineBreak
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage
import top.mcwebsite.playandroid.common.uiWidget.skeleton

@Composable
fun SkeletonItem() {
    Column(
        modifier = Modifier
            .fillMaxWidth()
            .padding(horizontal = 16.dp)
            .padding(top = 16.dp)
    ) {
        Row(verticalAlignment = Alignment.CenterVertically) {
            Text(text = "作者: 玩安卓", style = MaterialTheme.typography.titleSmall, modifier = Modifier.skeleton(true))
            Spacer(modifier = Modifier.weight(1f))
            Text(
                text = "2023-11-25",
                style = MaterialTheme.typography.labelMedium,
                modifier = Modifier.skeleton(true)
            )
        }
        Spacer(modifier = Modifier.height(5.dp))
        Row {
            Column(
                modifier = Modifier
                    .weight(1f)
                    .fillMaxHeight()
            ) {
                Text(
                    text = "和我一起来玩安卓呀",
                    style = MaterialTheme.typography.titleMedium.copy(lineBreak = LineBreak.Simple),
                    modifier = Modifier
                        .fillMaxWidth()
                        .skeleton(true)
                )
                Text(
                    text = "这里是玩安卓应用，这里是玩安卓应用,这里是玩安卓应用,这里是玩安卓应用,这里是玩安卓应用",
                    style = MaterialTheme.typography.bodyMedium,
                    maxLines = 3,
                    overflow = TextOverflow.Ellipsis,
                    color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.56f),
                    modifier = Modifier.skeleton(true)
                )
            }
            Spacer(modifier = Modifier.width(5.dp))
            Box(
                modifier = Modifier
                    .size(70.dp)
                    .skeleton(true)
            )
        }
        Row(
            modifier = Modifier.padding(vertical = 5.dp)
        ) {
            Text(text = "玩安卓", style = MaterialTheme.typography.labelMedium, modifier = Modifier.skeleton(true))
            Spacer(modifier = Modifier.width(5.dp))
            Text(
                text = "玩安卓",
                style = MaterialTheme.typography.labelMedium,
                modifier = Modifier.skeleton(true)
            )
        }
        Spacer(modifier = Modifier.height(16.dp))
        Divider()
    }
}